<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script>

        /*点击图片进行图片切换*/
        window.onload=function (){
            var img=document.getElementById("code");
            img.onclick=function () {
                /*时间戳*/
                var time = new Date().getTime();
                img.src="/session/code?"+time;
            }
        }

    </script>
    <style>
        div{
            color:red;
        }
    </style>
</head>
<body>
<form action="/session/loginservlet" method="post">
    <table>
        <tr>
            <td>用户名</td>
            <td><input type="text" name="username"></td>
        </tr>
        <tr>
            <td>密码</td>
            <td><input type="password" name="password"></td>
        </tr>
        <tr>
            <td>验证码</td>
            <td><input type="text" name="checkCode"></td>
        </tr>
        <tr>
            <td colspan="2"><img id="code" src="/session/code"></td>
        </tr>
        <tr>
            <td colspan="2"><input type="submit" value="登录"></td>
        </tr>
    </table>


</form>
<div><%=request.getAttribute("cc_error")==null?"" : request.getAttribute("cc_error")%></div>
<div><%=request.getAttribute("login_error")==null?"" : request.getAttribute("login_error")%></div>
</body>
</html>
